package jvm;

class Member {}

public class JVMArguments {
    public static void main1(String[] args) {
        // String是一个系统类，系统类里面的类加载器是不同的
         String str = "hello" ; // 静态常量池进行定义
         System.out.println(str.getClass().getClassLoader());
    }

    public static void main2(String[] args) {
        Member member = new Member();       // 实例化了一个自定义类对象
        System.out.println(member.getClass().getClassLoader());
        System.out.println(member.getClass().getClassLoader().getParent());
        System.out.println(member.getClass().getClassLoader().getParent().getParent());
    }

    public static void main3(String[] args) {
        fun();
    }
    public static void fun(){
        System.out.println(Math.random());
        fun();
    }

    public static void main(String[] args) {
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Runtime.getRuntime().totalMemory()/1024/1024);
        System.out.println(Runtime.getRuntime().maxMemory()/1024/1024);

        String str = "hello";
        for (int i=0; i<Integer.MAX_VALUE; i++){
            str += str.intern();
        }
    }
}